﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using JXPlatform.GIS.ViewModels;
using ESRI.ArcGIS.Controls;

namespace JXPlatform.GIS.Views
{
    /// <summary>
    /// Interaction logic for TocView.xaml
    /// </summary>
    
    [Export]
    public partial class TocView : UserControl
    {
        private readonly AxTOCControl _tocControl;

        public TocView()
        {
            InitializeComponent();

            _tocControl = new AxTOCControl();
            tocHost.Child = _tocControl;
        }

        [Import]
        public TocViewModel TocViewModel
        {
            get { return DataContext as TocViewModel; }
            set { DataContext = value; }
        }

        public object Buddy
        {
            get { return _tocControl.Buddy; }
            set { _tocControl.SetBuddyControl(value); }
        }
    }
}
